package com.onenine.app.activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.onenine.app.R;
import com.onenine.app.utils.DataType;
import com.onenine.base.base.BaseActivity;

/**
 * 创建时间：2018/6/7 0007 18:27
 * 创建人：fly
 * 功能描述：聊天举报选项
 */
public class ReportOptionActivity extends BaseActivity {

    private int mObjType;
    private String mTargetId;

    public static void launchActivity(Context context, int complainObjType, String targetId) {
        Intent intent = new Intent(context, ReportOptionActivity.class);
        intent.putExtra("complainObjType", complainObjType);
        intent.putExtra("targetId", targetId);
        context.startActivity(intent);
    }

    @Override
    protected void initViews() {
        super.initViews();
        mObjType = getIntent().getIntExtra("complainObjType", DataType.REPORT_GROUP);
        mTargetId = getIntent().getStringExtra("targetId");
        mToolbar.setCenterTitle(mObjType == DataType.REPORT_USER ? R.string.report_user : R.string.report_group);
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_report_chatroom;
    }

    public void onViewClick(View view) {
        if (view.getTag() == null) {
            return;
        }
        ReportSubmitActivity.launchReportActivity(this, mObjType
                , Integer.parseInt(view.getTag().toString()), mTargetId);
        finish();
    }

}
